//
//  ModifNikNameCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/9/9.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class ModifNikNameCell: BaseTableViewCell {

    @IBOutlet weak var textField: UITextField!
    
    
    var nikNameStr : String?{
    
        didSet{
        
            if nikNameStr == nil{
            
            return
            }
            
            textField.text = nikNameStr
        
        }
    
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.white
        
        textField.delegate = self
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}



extension ModifNikNameCell :UITextFieldDelegate{

    func textFieldDidEndEditing(_ textField: UITextField) {
        
        if textField.text == nil{
            
        return
        
        }
        
        if textField.text!.characters.count > 0 {
            nikNameStr = textField.text
        }
    }



}
